<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>京西店家</title>
  <link rel="stylesheet" type="text/css" href="css/index.css" />

</head>

<body bgcolor="#F0F8FF">

<div class="page">
  <div>
    <br>
  </div>
  <ul id="jsddm">
    <li>
      <a href="../boss/bossindex">首页</a>
    </li>
    <li onmouseover="showSubMenu(this)" onmouseout="hideSubMenu(this)">
      <a>商品分类</a>
      <ul>
        <li><a href="../boss/ShowType?tid=101">服饰</a></li>
        <li><a href="../boss/ShowType?tid=102">食品</a></li>
        <li><a href="../boss/ShowType?tid=103">书籍</a></li>
        <li><a href="../boss/ShowType?tid=104">科技</a></li>
        <li><a href="../boss/ShowType?tid=105">日用</a></li>
      </ul>
    </li>
    <li>
      <a href="orderList">我的订单</a>
    </li>
    <li onmouseover="showSubMenu(this)" onmouseout="hideSubMenu(this)">
      <a >个人中心</a>
      <ul>
        <li><a href="../boss/bossindex.jsp">个人中心</a></li>
        <li><a href="../boss/logout">退出登录</a></li>
      </ul>
    </li>
    <li style="width: 331px">
      <form action="../boss/getGoodsByGname" method="post">
        <input type="text" name="gname" style="width: 200px;height: 30px;border:1px solid #000000;">
        <input type="submit" name="submit" value="搜索" style="border:1px solid #000000;width: 40px;height: 25px">
      </form>
    </li>
  </ul>
  <script type="text/javascript">
    //显示子菜单
    function showSubMenu(li){
      var subMenu = li.getElementsByTagName("ul")[0];
      subMenu.style.display = "block";
    }

    //隐藏子菜单
    function hideSubMenu(li){
      var subMenu = li.getElementsByTagName("ul")[0];
      subMenu.style.display = "none";
    }

    function num_jia(){
      var i = event.target.id.slice(2);
      var x = document.getElementById("number_"+i);
      var y = document.getElementById("price_"+i).innerHTML;
      var z = document.getElementById("allprice_"+i);
      var a = parseInt(x.value);
      var b = parseInt(y);
      a++;
      x.value=a;
      z.innerHTML=a*b.toString();
    }

    function num_jian(){
      var i = event.target.id.slice(2);
      var x = document.getElementById("number_"+i);
      var y = document.getElementById("price_"+i).innerHTML;
      var z = document.getElementById("allprice_"+i);
      var a = parseInt(x.value);
      var b = parseInt(y);
      if(a>1){
        a--;
      }else{
        a=1;
      };
      x.value=a;
      z.innerHTML=a*b.toString();
    }
    function button_picture(){
      var add = document.getElementById("address");
      var obj = document.getElementById("picture");
      obj.src = add.value;
    }

  </script>

  <div class="content">

    <div class="you" style="text-align: center;width: 1000px">
      <div class="clearit"></div>

      <form action="update" method="post"  style="text-align: center;width: 1000px">
      <!-- <form action="insertGoods?bid=1" method="post"> -->
      <table style="margin:auto">
        <tr>
          <td style="width: 60px;height: 30px">商品名</td>
          <td><input type="text"  name="gname" style="width: 500px;height: 30px" value="${good.gname}"></td>
        </tr>
        <tr>
          <td style="width: 60px;height: 30px">价格</td>
          <td><input type="number" name="gprice" style="width: 500px;height: 30px" value="${good.gprice}">
          </td>
        </tr>
        <tr>
          <td style="width: 60px;height: 30px" >种类</td>
          <td>
            <select name="gtype" style="border:1px solid #000000;">
              <option value="101">服饰</option>
              <option value="102">食品</option>
              <option value="103">书籍</option>
              <option value="104">科技</option>
              <option value="105">日用</option>
            </select>
          </td>
        </tr>
        <tr style="width: 500px;height: 500px">
          <td style="width: 60px;height: 30px">图片地址</td>
          <td><input type="text" name="picture" style="width: 400px;height: 30px;border:1px solid #000000" id="address" value="${good.picture}">
            <br>
            <br><input type="button" value="上传图片" style="border:1px solid #000000;width: 100px;height: 25px; font-size: 12px;text-align: center" onclick="button_picture()">
            <br><br>
            <img src="" width="400px" height="400px" id="picture"></td>
        </tr>

        <tr>
          <td style="width: 60px;height: 30px">描述</td>
          <td><textarea name="gdetail" style="width: 500px;height: 200px" value="${good.gdetail}"></textarea></td>
        </tr>

        <tr>
          <td  style="width: 60px;height: 30px">库存</td>
          <td><input type="number" name="gstore" style="width: 500px;height: 30px" value="${good.gstore}"></td>
        </tr>

      </table>
      <br>
      <input type="submit" value="提交" style="border:1px solid #000000;width: 100px;height: 40px; font-size: 16px">
      <input type="reset"  value="重置" style="border:1px solid #000000;width: 100px;height: 40px; font-size: 16px"> 
      </form>

      <!---------------------------------------------------↑ 首页随机商品接口 ↑--------------------------------->



    </div>
    <br>
    <div class="clearit"></div>

  </div>
</div>
<div>
  <p class="banquan">&nbsp;</p>
  <p class="banquan">版权所有：刘艺杰、安森泰、张恒超、卢晓丹、贾文婷 2021-现在</p>
  <a href="mailto:2629145453@qq.com"><p class="banquan">联系我们</p></a>
  <p class="banquan">&nbsp;</p>
</div>

</body>
</html>
